﻿using System;
using System.Windows;

using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Logging;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Prism.Regions;
using Infrastructure;

namespace rsstree
{
    public class TreeModule : IModule
    {
        IRegionManager _regionManager;
        IUnityContainer _container;
        ILoggerFacade logger;

        public TreeModule(IUnityContainer container, IRegionManager regionManager, ILoggerFacade logger)
        {
            _container = container;
            _regionManager = regionManager;
            this.logger = logger;
        }

        public void Initialize()
        {
            logger.Log("初始化Tree模块", Category.Debug, Priority.Low);
            _regionManager.RegisterViewWithRegion(RegionNames.NavRegion, typeof(TreeModule));
            _container.RegisterType<object, TreePage>(ViewNames.TreePage);
        }

    }
}
